﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SDMX_ML.Framework.Metadata
{
    public enum ObjectIDType
    {
        Agency,
        ConceptScheme,
        Concept,
        Codelist,
        Code,
        KeyFamily,
        Component,
        KeyDescriptor,
        MeasureDescriptor,
        AttributeDescriptor,
        GroupKeyDescriptor,
        Dimension,
        Measure,
        Attribute,
        CategoryScheme,
        ReportingTaxonomy,
        Category,
        OrganisationScheme,
        DataProvider,
        MetadataStructure,
        FullTargetIdentifier,
        PartialTargetIdentifier,
        MetadataAttribute,
        DataFlow,
        ProvisionAgreement,
        MetadataFlow,
        ContentConstraint,
        AttachmentConstraint,
        DataSet,
        XSDataSet,
        MetadataSet,
        HierarchicalCodelist,
        Hierarchy,
        StructureSet,
        StructureMap,
        ComponentMap,
        CodelistMap,
        CodeMap,
        CategorySchemeMap,
        CategoryMap,
        OrganisationSchemeMap,
        OrganisationRoleMap,
        ConceptSchemeMap,
        ConceptMap,
        Process,
        ProcessStep,
        Unknown
    }

    internal class EnumerationConvert
    {

        internal static ObjectIDType EnumObjectIDTypeFromString(string enumValue)
        {

            ObjectIDType objectIDType = ObjectIDType.Unknown;

            switch (enumValue.ToLower())
            {
                case "agency":
                    objectIDType = ObjectIDType.Agency;
                    break;
                case "metadataflow":
                    objectIDType = ObjectIDType.MetadataFlow;
                    break;
                case "category":
                    objectIDType = ObjectIDType.Category;
                    break;
                case "dataprovider":
                    objectIDType = ObjectIDType.DataProvider;
                    break;
                case "codelist":
                    objectIDType = ObjectIDType.Codelist;
                    break;
                case "conceptScheme":
                    objectIDType = ObjectIDType.ConceptScheme;
                    break;
                case "concept":
                    objectIDType = ObjectIDType.Concept;
                    break;
                case "code":
                    objectIDType = ObjectIDType.Code;
                    break;
                case "keyfamily":
                    objectIDType = ObjectIDType.KeyFamily;
                    break;
                case "component":
                    objectIDType = ObjectIDType.Component;
                    break;
                case "keydescriptor":
                    objectIDType = ObjectIDType.KeyDescriptor;
                    break;
                case "measuredescriptor":
                    objectIDType = ObjectIDType.MeasureDescriptor;
                    break;
                case "attributedescriptor":
                    objectIDType = ObjectIDType.AttributeDescriptor;
                    break;
                case "groupkeydescriptor":
                    objectIDType = ObjectIDType.GroupKeyDescriptor;
                    break;
                case "dimension":
                    objectIDType = ObjectIDType.Dimension;
                    break;
                case "measure":
                    objectIDType = ObjectIDType.Measure;
                    break;
                case "attribute":
                    objectIDType = ObjectIDType.Attribute;
                    break;
                case "categoryscheme":
                    objectIDType = ObjectIDType.CategoryScheme;
                    break;
                case "reportingtaxonomy":
                    objectIDType = ObjectIDType.ReportingTaxonomy;
                    break;
                case "organisationscheme":
                    objectIDType = ObjectIDType.OrganisationScheme;
                    break;
                case "metadatastructure":
                    objectIDType = ObjectIDType.MetadataStructure;
                    break;
                case "fulltargetidentifier":
                    objectIDType = ObjectIDType.FullTargetIdentifier;
                    break;
                case "partialtargetidentifier":
                    objectIDType = ObjectIDType.PartialTargetIdentifier;
                    break;
                case "metadataattribute":
                    objectIDType = ObjectIDType.MetadataAttribute;
                    break;
                case "dataflow":
                    objectIDType = ObjectIDType.DataFlow;
                    break;
                case "provisionagreement":
                    objectIDType = ObjectIDType.ProvisionAgreement;
                    break;
                case "contentconstraint":
                    objectIDType = ObjectIDType.ContentConstraint;
                    break;
                case "attachmentconstraint":
                    objectIDType = ObjectIDType.AttachmentConstraint;
                    break;
                case "dataset":
                    objectIDType = ObjectIDType.DataSet;
                    break;
                case "xsdataset":
                    objectIDType = ObjectIDType.XSDataSet;
                    break;
                case "metadataset":
                    objectIDType = ObjectIDType.MetadataSet;
                    break;
                case "hierarchicalcodelist":
                    objectIDType = ObjectIDType.HierarchicalCodelist;
                    break;
                case "hierarchy":
                    objectIDType = ObjectIDType.Hierarchy;
                    break;
                case "structureset":
                    objectIDType = ObjectIDType.StructureSet;
                    break;
                case "structuremap":
                    objectIDType = ObjectIDType.StructureMap;
                    break;
                case "componentmap":
                    objectIDType = ObjectIDType.ComponentMap;
                    break;
                case "codelistmap":
                    objectIDType = ObjectIDType.CodelistMap;
                    break;
                case "codemap":
                    objectIDType = ObjectIDType.CodeMap;
                    break;
                case "categoryschememap":
                    objectIDType = ObjectIDType.CategorySchemeMap;
                    break;
                case "categorymap":
                    objectIDType = ObjectIDType.CategoryMap;
                    break;
                case "organisationschememap":
                    objectIDType = ObjectIDType.OrganisationScheme;
                    break;
                case "organisationrolemap":
                    objectIDType = ObjectIDType.OrganisationSchemeMap;
                    break;
                case "conceptschememap":
                    objectIDType = ObjectIDType.ConceptSchemeMap;
                    break;
                case "conceptmap":
                    objectIDType = ObjectIDType.ConceptMap;
                    break;
                case "process":
                    objectIDType = ObjectIDType.Process;
                    break;
                case "processstep":
                    objectIDType = ObjectIDType.ProcessStep;
                    break;
                
            }

            return objectIDType;
        }
    }
}
